package com.woniuxy.job;

import com.woniuxy.service.StationScheduleService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

//@Component
public class StationScheduleChecker {

    private final StationScheduleService scheduleService;

    public StationScheduleChecker(StationScheduleService scheduleService) {
        this.scheduleService = scheduleService;
    }

    // 每分钟触发一次（cron表达式：秒 分 时 日 月 周）
    @Scheduled(cron = "0 * * * * *")
    public void checkStationStatus() {
        scheduleService.checkAndUpdateStatus();
    }
}